class Test {
    public int year;
    public int nomth;
    public int day;

    Test() {
        System.out.println("这是一个不带参数的构造方法");

    }

    public void printTest() {
        System.out.println(year);

    }

}

public class Deom {
    public static void main(String[] args) {
        Test test = new Test();


    }

    //类变量的应用
    public static void main1(String[] args) {
        Test test1 = new Test();
        test1.year++;
        Test test2 = new Test();
        test2.year++;
        Test test3 = new Test();
        test3.year--;
        test3.printTest();
    }
}

